/*
 * BlueZombie.cpp
 *
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses 
 */

#include "BlueZombie.h"
#include "ModelConstants.h"
#include "MovStrategyFactory.h"

BlueZombie::BlueZombie(int x, int y)
    : Enemy(x, y) {
    init();
}

BlueZombie::BlueZombie(int id, int x, int y)
    : Enemy(id, x, y) {
    init();
}

void BlueZombie::init() {
    Properties properties = Properties();
    resistance = properties.getPropertyAsInt("enemy_resistance");
    speed = properties.getPropertyAsInt("enemy_speed") / 2;
    mov_strategy = MovStrategyFactory::createMovementStrategy(ZOMBIE_BLUE, this);
    range = properties.getPropertyAsInt("b_zombie_range");
    points = properties.getPropertyAsInt("b_zombie_points");
    direction = getRandomDirection();
}

BlueZombie* BlueZombie::clone() {
    BlueZombie* clone = new BlueZombie(*this);
    clone->mov_strategy = MovStrategyFactory::createMovementStrategy(ZOMBIE_BLUE, clone);
    return clone;
}

ModelObject BlueZombie::getRepresentation() {
    return ZOMBIE_BLUE;
}
